package com.xiye.im.netty.server;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @Package com.xiye.im.netty.server
 * @Description netty随项目启动
 * @Author 西野
 * @Date 2018-09-13
 * @Version V1.0
 */
@WebListener
public class NettyListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        new Thread() {
            @Override
            public void run() {
                try {
                    new ChatServer().start();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
